Dashboards are UI Extensibility Framework components that are used to provide the user interface for extensibility applications. Dashboards run on browser control that can host ActiveX controls as a part of the user interface. M-Files provides some built-in ActiveX controls that can be used to customize the M-Files look and feel.
ActiveX controls are created in HTML code with <object> tag, with classid attribute set to component's CLSID. Because each M-Files version has different CLSID for its components, a fixed CLSID must not be used, but the component's CLSID must be referred as a named constant. Therefore the HTML code for ActiveX controls usually needs to be constructed dynamically.
Currently available built-in ActiveX controls and their class ID constants:
Embedding Additional Listings
In addition to the normal shell listing, additional listing object can be created and displayed on dashboards. The ActiveX control implements the AttachToListingWindow method, that is used to attach the ActiveX control with the listing object. The listing (content) object to attach can be created with CreateAdditionalListingForPath Method or CreateAdditionalListingForView Method.
The ShellListingCtrl.AttachToListingWindow method |
Copy Code
|
---|---|
void AttachToListingWindow( [ in ] IUnknown* shellListing ); |
The code below illustrates how to create the ShellListingCtrl ActiveX object dynamically in HTML code. It utilizes jQuery library for HTML DOM modifications.
Creating ShellListingCtrl object dynamically HTML |
Copy Code
|
---|---|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <!-- Include the jQuery Core library -->
<!-- Dashboard implementation -->
"use strict"; /**
// Register a handler to listen to the started event.
/**
// Return the event handler.
// Create new listing object. The shell frame was passed as a custom data.
// Add the ActiveX control to the DOM.
// Attach the listing to the ActiveX control. </script> </head>
<!-- The dashboard content --> |
Embedding File Previewers
File previewer ActiveX component can display file content previews for any supported file format for files in M-Files or on local disk. It should be created dynamically by using MFiles.CLSID.PreviewerCtrl as class ID, in similar manner like the ShellListCtrl is created above.
The PreviewCtrl ActiveX object exposes following methods:
Example Title |
Copy Code
|
---|---|
HRESULT ShowFilePreview(
[ in ] BSTR bstrFilenameWithAbsolutePath
);
HRESULT ClearPreview();
|